using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;

namespace PasswordProvider.ObjectModel
{
    [Serializable()]
    public class AuthenticationException : InvalidOperationException
    {
        public AuthenticationException() 
            : base("Authentication is required for this method. Must Authenticate with valid password.")
        { }
        public AuthenticationException(string message)
            : base(message)
        { }
        public AuthenticationException(string message, Exception innerException) :
            base(message, innerException)
        { }
        protected AuthenticationException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
    }

    [Serializable()]
    public class CorruptFileException : InvalidOperationException
    {
        public CorruptFileException()
            : base("The file is corrupt and/or has bad xml")
        {}
        public CorruptFileException(string message)
            : base(message)
        { }
        public CorruptFileException(string message, Exception innerException)
            : base(message, innerException)
        { }
        protected CorruptFileException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
    }

    [Serializable()]
    public class InvalidFileTypeException : InvalidOperationException
    {
        public InvalidFileTypeException()
            : base("The file is valid xml but does not contain password provider data.")
        { }
        public InvalidFileTypeException(string message)
            : base(message)
        { }
        public InvalidFileTypeException(string message, Exception innerException) :
            base(message, innerException)
        { }
        protected InvalidFileTypeException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
    }
}


